<?php
$T->loadTpl("./html/".$template."/".$qname.".html");
$T->SetTpl('cssjs','html/cssjs.inc'); 
$T->SetTpl('jsmodel','html/jsmodel.inc');     
  
$id=isset($_GET["id"])?$_GET["id"]:"0";

$T->readDB("select A.content,A.time,B.truename as s_name from sys_announce A left join sys_member B on B.id=A.sender where A.id='".$id."'");
$acceptsch = $T->db->query("select acceptsch from sys_announce where id='".$id."'")->fetchColumn(0);
$acceptscharr = explode(',', $acceptsch);
$acceptschnamestr = '';
foreach ($acceptscharr as $k => $val) {
    $name = $T->db->query("select sch_name from sys_school where id='".$val."'")->fetchColumn(0);
    $acceptschnamestr.= $name.',';
}
$acceptschnamestr = rtrim($acceptschnamestr,',');  

$attachment=$T->db->query("select attachment from sys_announce where id='".$id."'")->fetchColumn(0);
//if($attachment!=''){
    $attachment=explode(",", $attachment);
    foreach($attachment as $k=>$v){
        $attachment[$k]="'".$v."'";
    }
    $attachment=implode(",", $attachment);
    $T->SetBlock("attachment", "select * from sys_announce_attachment where id in({$attachment}) order by `timestamp`");
//}
$T->Set("acceptschnamestr",$acceptschnamestr);
        
$T->Set("template",$template);         
$T->clearNaN();       
$T->clearNoN();
$T->display(); 